Skip to content

Allow setting slog handler from env var#381

Merged
bgentry merged 2 commits intoriverqueue:masterfrom
pcriv:master
Jul 24, 2025
Merged

Allow setting slog handler from env var#381
bgentry merged 2 commits intoriverqueue:masterfrom
pcriv:master

Conversation

@pcriv
Copy link
Copy Markdown
Contributor

@pcriv pcriv commented Jul 24, 2025

Simple PR to allow setting the slog Handler as a JSON handler by using the RIVER_LOG_FORMAT env variable

@brandur
Copy link
Copy Markdown
Collaborator

brandur commented Jul 24, 2025

@bgentry Thoughts on this one? I initially thought this was on the main project and was a little skeptical about that, but we do use quite a few env vars in the UI already so it makes more sense though.

@pcriv I'm kind of thinking that if we go with this we should remove the abbreviation and use something like RIVER_LOG_FORMAT. "log fmt" sounds too much like "logfmt" [1], which is the informal name of the Heroku-style key/value logging pair format.

Ignore Docker build failures. Those builds don't work for third party contributors.

[1] https://brandur.org/logfmt

@pcriv
Copy link
Copy Markdown
Contributor Author

pcriv commented Jul 24, 2025

Thanks for the suggestions! @brandur ofc I can update that 👍🏽

Copy link
Copy Markdown
Contributor

@bgentry bgentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this generally, thanks for the suggestion! I have some specific ideas to clean it up, left comments on those.

Also could you please add yourself to the CLA?

Comment thread cmd/riverui/main.go Outdated
Comment thread cmd/riverui/main.go Outdated
@pcriv
Copy link
Copy Markdown
Contributor Author

pcriv commented Jul 24, 2025

@bgentry I cleaned up the code a bit, lmk if it's better now

Copy link
Copy Markdown
Contributor

@bgentry bgentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better! 🤩 Thank you.

@pcriv
Copy link
Copy Markdown
Contributor Author

pcriv commented Jul 24, 2025

Thanks to you folks! Happy to contribute just a little bit to this awesome project :)

@bgentry bgentry merged commit b4ef845 into riverqueue:master Jul 24, 2025
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants